// Decompiled on 周六 2月 22 19:31:49 CST 2025 with Zomboid Decompiler v0.1.3 using Vineflower.
package zombie.randomizedWorld.randomizedDeadSurvivor;

import java.util.ArrayList;
import zombie.inventory.ItemPickerJava;
import zombie.iso.BuildingDef;
import zombie.iso.IsoGridSquare;
import zombie.iso.objects.IsoDeadBody;
import zombie.util.list.PZArrayUtil;

public final class RDSSpecificProfession extends RandomizedDeadSurvivorBase {
    private final ArrayList<String> specificProfessionDistribution = new ArrayList();

    @Override
    public void randomizeDeadSurvivor(BuildingDef def) {
        IsoGridSquare isoGridSquare = def.getFreeSquareInRoom();
        if (isoGridSquare != null) {
            IsoDeadBody isoDeadBody = createRandomDeadBody(isoGridSquare.getX(), isoGridSquare.getY(), isoGridSquare.getZ(), null, 0);
            if (isoDeadBody != null) {
                ItemPickerJava.ItemPickerRoom itemPickerRoom = ItemPickerJava.rooms.get(PZArrayUtil.pickRandom(this.specificProfessionDistribution));
                ItemPickerJava.rollItem(itemPickerRoom.Containers.get("counter"), isoDeadBody.getContainer(), true, null, null);
            }
        }
    }

    public RDSSpecificProfession() {
        this.specificProfessionDistribution.add("Carpenter");
        this.specificProfessionDistribution.add("Electrician");
        this.specificProfessionDistribution.add("Farmer");
        this.specificProfessionDistribution.add("Nurse");
    }
}
